package com.pnk087.hr.dao;

/**
 * User: khanh
 * Date: 6/22/11 3:18 PM
 */
public interface GenericDao<T> {

   /**
    * Looks up and returns the object of Generic type T identified by the
    * primary key provided
    *
    * @param id the primary key of the object to find.
    * @return the Object of type T uniquely identified by the id.
    * @throws org.springframework.orm.ObjectRetrievalFailureException
    *          if their is no domain object with the id provided.
    */
   T findById(Long id);

   /**
    * Generic method to save an object.
    *
    * @param object the object to save
    */
   void save(T object);

   /**
    * Generic method to delete an object based on class and id
    *
    * @param id the identifier (primary key) of the object to remove
    */
   void remove(Long id);
}
